package com.keven.dp.singleton;

import java.util.Vector;
//采用"影子实例"的办法为单例对象的属性同步更新
public class SingletonTest4 {

	private static SingletonTest4 instance = null;
	private Vector properties = null;

	public Vector getProperties() {
		return properties;
	}

	private SingletonTest4() {
	}

	private static synchronized void syncInit() {
		if (instance == null) {
			instance = new SingletonTest4();
		}
	}

	public static SingletonTest4 getInstance() {
		if (instance == null) {
			syncInit();
		}
		return instance;
	}

	public void updateProperties() {
		SingletonTest4 shadow = new SingletonTest4();
		properties = shadow.getProperties();
	}
	
}
